package com.oreilly.ez.repo;

import com.oreilly.ez.entity.CourseTerm;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;


public interface CourseTermRepo extends JpaRepository<CourseTerm, Integer>{


    @Query("select c from CourseTerm c where c.course.sid = :courseId")
    Page<CourseTerm> findByCourseId(@Param("courseId") Integer courseId, Pageable pageable);
}
